<template>
  <div class="home-head" style="width:100%;">
    <div class="gd-headTop">
      <div class="zyy_indexTop" style="position: relative" align="center">
        <span
          style="
            color: #fff;
            position: absolute;
            left: 0;
            font-size: 25px;
            top: 50%;
            transform: translateY(-50%);
            cursor: pointer;
          "
          v-if="showLeft"
          @click="goBack"
        >
          <
        </span>
        <div class="search">
          {{ name }}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "homeHead",
  props: {
    name: String,
    showLeft: false, 
    showPerson:Boolean,
  }, 
  methods: {
    // 返回
    goBack() { 
      if(this.showPerson) {
        this.$router.push("/my");
      }else {
        this.$router.go(-1);
      }
    },
  },
};
</script>
<style lang="scss" scoped>
@import "../../assets/css/zyy_phone.css";
@import "../../assets/css/search.css";
.search {
  z-index: 999;
  font-size: 18px;
  color: #fff;
  vertical-align: middle;
}
.home-head {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}
</style>